// Fill out your copyright notice in the Description page of Project Settings.
#include "UI/Style/SlateDemoManager.h"
#include "Styling/SlateStyleRegistry.h"
#include "Slate/SlateGameResources.h"




TSharedPtr<FSlateStyleSet> SlateDemoManager::StyleInstance = NULL;

void SlateDemoManager::Initialize()
{
	if (!StyleInstance.IsValid())
	{
		StyleInstance = Create();
		FSlateStyleRegistry::RegisterSlateStyle(*StyleInstance);
	}
}

FName SlateDemoManager::GetStyleSetName()
{
	static FName SlateSetName(TEXT("SlateDemoStyle"));
	return SlateSetName;
}

void SlateDemoManager::ShutDown()
{
	FSlateStyleRegistry::UnRegisterSlateStyle(*StyleInstance);
	ensure(StyleInstance.IsUnique());
	StyleInstance.Reset();
}

const ISlateStyle& SlateDemoManager::Get()
{
	return *StyleInstance;
}

TSharedRef<FSlateStyleSet> SlateDemoManager::Create()
{
	TSharedRef<FSlateStyleSet> StyleRef = FSlateGameResources::New(SlateDemoManager::GetStyleSetName(),
		"/Game/UI/Style", "/Game/UI/Style");
	return StyleRef;
}
